$(document).ready(function(){

     //鼠标移动至链接
    $("[href]").mouseenter(function(){
        $(this).css("border-bottom","4px solid grey");
    })
    //鼠标从链接移开
    $("[href]").mouseleave(function(){
        $(this).css("border-bottom","0px");
    })
    //点击链接
    $("[href]").click(function(){
        $(this).css("border-bottom","4px solid CornflowerBlue");
    })
    //点击加速
    $("#speed").click(function(){
        var speed = $("#speed");
        speed.animate({top:'-200px',opacity:'0'},3000);
        speed.animate({top:'800px',opacity:'0'},0);
        speed.animate({top:'500px',opacity:'1'},900);
    })
    
    //用户数据登记表
    var i = 1;
    $("#submitButton").click(function(){
        i++;
        $("#people_number").text(i);
        var name = $("#name").val();
        var income =$("#income").val();
        var post = $("#post").val();
        //alert(name); 
        var table = $("#people_table");
        table.append("<tr id="+i+"man><td>"+name+"</td><td>"+income+"</td><td>"+post+"</td><td><button class='delete_people' id="+i+"del>删除</button></td></tr>");
        $("#name").val('');
        $("#income").val('');
        $("#post").val('');
    })

    $("#clearButton").click(function(){
        $("#name").val('');
        $("#income").val('');
        $("#post").val('');
    })

    // 删除某行
    $(".delete_people").click(function(){
        $(".delete_people").closest("tr").remove();
        i--;
        $("#people_number").text(i);
    })
    
})